473,469 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How Do I Center This Sample Webpage In Firefox?

Does anyone know how to center this sample webpage in Firefox? If so,
will you provide the example as it applies to this sample webpage? I
have read numerous posts and articles on how to center content with
CSS...none are working for me. The best I can do at this point is the
"text-align: center" for my div tag, but that only works in IE. I want
to be able to center all the content within the div (effectively center
the site content) for both IE and Firefox...

---
<%@ Register TagPrefix="T" TagName="MainHeader" Src="/MainHeader.ascx"
%>
<%@ Register TagPrefix="T" TagName="Banner" Src="/Banner.ascx" %>
<%@ Page language="c#" Codebehind="Default.aspx.cs"
AutoEventWireup="false" Inherits="T.Default" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>T Home</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="/Base.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<div style="MARGIN-LEFT:auto; WIDTH:100%; MARGIN-RIGHT:auto">
<table class="Main">
<tr>
<td align="center">
<T:Banner id="BannerHeader" runat="server"></T:Banner>
</td>
</tr>
<tr>
<td align="center">
<T:MainHeader id="MainHeader" runat="server"></T:MainHeader>
</td>
</tr>
<tr>
<td align="left">
<asp:literal id="litMain" runat="server" Text=" "></asp:literal>
</td>
</tr>
<tr>
<td align="center">
<T:Banner id="BannerFooter" runat="server"></T:Banner>
</td>
</tr>
</table>
</div>
</form>
</body>
</HTML>

Nov 19 '05 #1
4 6245
<div align="center">
<div align="center">
place stuff here
</div>
</div>

--
Daniel Fisher(lennybacon)
"Joey" <jo*********@topscene.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Does anyone know how to center this sample webpage in Firefox? If so,
will you provide the example as it applies to this sample webpage? I
have read numerous posts and articles on how to center content with
CSS...none are working for me. The best I can do at this point is the
"text-align: center" for my div tag, but that only works in IE. I want
to be able to center all the content within the div (effectively center
the site content) for both IE and Firefox...

---
<%@ Register TagPrefix="T" TagName="MainHeader" Src="/MainHeader.ascx"
%>
<%@ Register TagPrefix="T" TagName="Banner" Src="/Banner.ascx" %>
<%@ Page language="c#" Codebehind="Default.aspx.cs"
AutoEventWireup="false" Inherits="T.Default" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>T Home</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="/Base.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<div style="MARGIN-LEFT:auto; WIDTH:100%; MARGIN-RIGHT:auto">
<table class="Main">
<tr>
<td align="center">
<T:Banner id="BannerHeader" runat="server"></T:Banner>
</td>
</tr>
<tr>
<td align="center">
<T:MainHeader id="MainHeader" runat="server"></T:MainHeader>
</td>
</tr>
<tr>
<td align="left">
<asp:literal id="litMain" runat="server" Text=" "></asp:literal>
</td>
</tr>
<tr>
<td align="center">
<T:Banner id="BannerFooter" runat="server"></T:Banner>
</td>
</tr>
</table>
</div>
</form>
</body>
</HTML>

Nov 19 '05 #2
I have noticed that Mozilla based browsers tend to disregard inline
CSS. So, therefore, try something like
<head><style>.MyClassStyle{color:#ff0000;}</style></head><body><div
class="MyClassStyle">This text should be red.</div></body></html>

Hope this helps more.
Daniel Fisher(lennybacon) wrote:
<div align="center">
<div align="center">
place stuff here
</div>
</div>

--
Daniel Fisher(lennybacon)
"Joey" <jo*********@topscene.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Does anyone know how to center this sample webpage in Firefox? If so,
will you provide the example as it applies to this sample webpage? I
have read numerous posts and articles on how to center content with
CSS...none are working for me. The best I can do at this point is the
"text-align: center" for my div tag, but that only works in IE. I want
to be able to center all the content within the div (effectively center
the site content) for both IE and Firefox...

---
<%@ Register TagPrefix="T" TagName="MainHeader" Src="/MainHeader.ascx"
%>
<%@ Register TagPrefix="T" TagName="Banner" Src="/Banner.ascx" %>
<%@ Page language="c#" Codebehind="Default.aspx.cs"
AutoEventWireup="false" Inherits="T.Default" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>T Home</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="/Base.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<div style="MARGIN-LEFT:auto; WIDTH:100%; MARGIN-RIGHT:auto">
<table class="Main">
<tr>
<td align="center">
<T:Banner id="BannerHeader" runat="server"></T:Banner>
</td>
</tr>
<tr>
<td align="center">
<T:MainHeader id="MainHeader" runat="server"></T:MainHeader>
</td>
</tr>
<tr>
<td align="left">
<asp:literal id="litMain" runat="server" Text=" "></asp:literal>
</td>
</tr>
<tr>
<td align="center">
<T:Banner id="BannerFooter" runat="server"></T:Banner>
</td>
</tr>
</table>
</div>
</form>
</body>
</HTML>


Nov 19 '05 #3
Daniel, while that solution works, it does not work in a CSS
stylesheet. What syntax is needed for that? I am sorry I was not more
clear in my original answer.

Specifically, I am looking for some CSS code that will center my site
content in Firefox.

Daniel Fisher(lennybacon) wrote:
<div align="center">
<div align="center">
place stuff here
</div>
</div>

--
Daniel Fisher(lennybacon)
"Joey" <jo*********@topscene.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Does anyone know how to center this sample webpage in Firefox? If so,
will you provide the example as it applies to this sample webpage? I
have read numerous posts and articles on how to center content with
CSS...none are working for me. The best I can do at this point is the
"text-align: center" for my div tag, but that only works in IE. I want
to be able to center all the content within the div (effectively center
the site content) for both IE and Firefox...

---
<%@ Register TagPrefix="T" TagName="MainHeader" Src="/MainHeader.ascx"
%>
<%@ Register TagPrefix="T" TagName="Banner" Src="/Banner.ascx" %>
<%@ Page language="c#" Codebehind="Default.aspx.cs"
AutoEventWireup="false" Inherits="T.Default" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>T Home</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
<LINK href="/Base.css" type="text/css" rel="stylesheet">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<div style="MARGIN-LEFT:auto; WIDTH:100%; MARGIN-RIGHT:auto">
<table class="Main">
<tr>
<td align="center">
<T:Banner id="BannerHeader" runat="server"></T:Banner>
</td>
</tr>
<tr>
<td align="center">
<T:MainHeader id="MainHeader" runat="server"></T:MainHeader>
</td>
</tr>
<tr>
<td align="left">
<asp:literal id="litMain" runat="server" Text=" "></asp:literal>
</td>
</tr>
<tr>
<td align="center">
<T:Banner id="BannerFooter" runat="server"></T:Banner>
</td>
</tr>
</table>
</div>
</form>
</body>
</HTML>


Nov 19 '05 #4
Arty,

I have no problems in implementing CSS with or without classes as
inline, imbedded, or linked. In fact, I am making extensive use of it
in my websites!

The problem is specifically: I have not been able to code any CSS class
that will center my site content in Firefox. I have read article after
article about #global, margin: auto, etc. Each "solution" seems
different, and none of them work for me. That is why I posted sample
code in my original post.

It is my opinion that this is WAY TOO COMPLICATED. For goodness sakes,
all I want to do is center some content! I could do that in HTML 1.0
with the old "depricated" 'center' tag!

Anyways, thanks for trying to help me.

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: john T | last post by:
Is there anyway to vertically center a html table using css in such a way it does not alter the html table. When I tryied it just screws up.
4
by: Philipp Lenssen | last post by:
Is it possible in IE6+NS7 to center-align a div of fixed width which itself contains elements which use "position: absolute"? Using "margin-left: auto" and "margin-right: auto" works well to center...
2
by: joey.powell | last post by:
Make Firefox Center Content in a div Or td Tag By Using CSS? Does anyone know how to do this. IE works great with text-align:center; but Firefox just always left-aligns...
7
by: Alex | last post by:
Hi Everone, I need some advice on how to setup 4 columns where the outside two are absolute (120px) and the inner two (side by side) are relevent (Fluid) and change with the screen. Here's my...
2
by: doug s | last post by:
How would I access the source of a webpage? I would like to get the source, then use a regexp to find text on a webpage. For example, retrieving a counter, or some other text that dynamically...
12
by: M.L. | last post by:
When loaded from my hard drive, the webpage I'm working on renders fine on IE6, Firefox 2.0.0.1, and Opera 9.02. However, after uploading it to the web there are 2 images that fail to display on...
6
by: Anton Vredegoor | last post by:
Since a few days I've been experimenting with a construct that enables me to send the sourcecode of the web page I'm reading through a Python script and then into a new tab in Mozilla. The new tab...
1
by: judacris | last post by:
I've seen the threads here about molding 2 divs in a centered fashion. but I can't seem to solve this thing. my blogger blog is functioning well on my site for now, but the blog feed (left) and...
13
by: Stevo | last post by:
I've found that for IE6+, if you add the property text-align:center to a DIV, then *anything* inside it gets centered. That can be a table, an object/embed, another DIV, an image, or some text. ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.